--[[
Author       : Bruce
Date         : 2024-12-22 11:52:01
LastEditors  : Bruce
LastEditTime : 2024-12-22 12:05:56
FilePath     : /utils/ui.lua
Description  :
Copyright 2024 Bruce, All Rights Reserved.
2024-12-22 11:52:01
--]]
local M = {}

-- 创建圆角矩形背景
function M.createRoundedBackground(x, y, width, height, color, radius)
    local frame = hs.geometry.rect(x, y, width, height)
    local background = hs.drawing.rectangle(frame)
    background:setFillColor(color)
    background:setRoundedRectRadii(radius, radius)
    background:setFill(true)
    background:setLevel(hs.drawing.windowLevels.overlay)
    return background
end

-- 创建文本
function M.createText(frame, text, style)
    local textObj = hs.drawing.text(frame, text)
    textObj:setTextStyle(style)
    return textObj
end

return M